<!DOCTYPE html>
<body>
    <head>
        <meta charset="utf-8">
        <title>自定义对话框显示JSON</title>
        <#include "/pubHeadStyle.html">
        <script src="${ctx}/extends/jquery.min.js" type="text/javascript"></script>
    </head>
    <body>
        <div class="queryData">
    <pre class="layui-code">对话框返回的JSON格式数据。
        1.单选为JSON对象数据,字段为return字段。<br/>
        2.多选为JSON数组,字段为return字段。<br/>
        <textarea id="jsonData" rows="" cols="80" style="min-height: 140px;max-width:410px"></textarea>
      </pre>
            <div style="margin:0 auto;text-align: center">
                <a class="layui-btn determine">
                    <span>确定</span>
                </a>
            </div>
        </div>
        <script>
            layui.config({
                base: serverPath.formPath + staticPath.formPath //静态资源所在路径
            }).extend({
                index: 'index' //主入口模块
            }).use(['index', 'commons','jquery', 'form', 'tree', 'commons', 'common', 'totalFilter', 'setter', 'code'], function () {
                var code = layui.code;
                layui.code();
                var index = parent.layer.getFrameIndex(window.name);

                var parentName = '${parentName}';
                var parentIndex;
                if (parentName != "" && parentName != "undefined") {
                    var ifr = window.parent.frames[parentName];
                    var win = ifr.window || ifr.contentWindow;
                    $("#jsonData").val(win.document.getElementById("txtJsonData").value);
                    parentIndex = win.document.getElementById("parentIndex").value;
                }
                $(".determine").on('click', function () {
                    parent.layer.close(parentIndex);
                    parent.layer.close(index);
                })
            })
        </script>
    </body>
    </html>